package com.itheima.reggie.mapper;

import com.itheima.reggie.dto.SetmealDto;
import com.itheima.reggie.entity.Setmeal;
import com.itheima.reggie.entity.SetmealDish;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface SetmealDishMapper {

    //void saveBeath(@Param("setmealDishes") List<SetmealDish> setmealDishes);
    //批量保存套餐
    void saveBatch(@Param("setmealDishes") List<SetmealDish> setmealDishes);
    /*删除套餐对应的菜品*/
    void deleteBySetmealIds(@Param("ids") List<Long> ids);
    /**
     * 根据套餐的类别展示套餐
     * @param categoryId
     * @param status
     * @return
     */
    @Select("select * from setmeal where category_id=#{categoryId} and status=#{status}")
    List<Setmeal> list(@Param("categoryId") long categoryId, @Param("status") Integer status);
    /*根据id查询套餐菜品*/
    @Select("select * from setmeal_dish where setmeal_id=#{id}")
    List<SetmealDish> findBySetmealId(Long id);
}
